<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateFormsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('forms', function(Blueprint $table)
		{
			$table->increments('id');
			$table->char('object_id', 36)->index('object_id_index')->comment('objectId');
			$table->string('form')->index('form_index')->comment('所属表单');
			$table->integer('user_id')->default(0)->index('user_id_index')->comment('用户id');
			$table->string('ip', 45)->comment('IP');
			$table->text('data', 65535)->comment('数据');
			$table->string('status')->default('1')->comment('状态');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('forms');
	}

}
